import request from '../utils/request.ts'
import {FormState} from '../type/user.ts'

//用户登录
export const userLoginApi = (data:FormState) => {
    return request.post('/user/login',data)
}

//用户注册
export const uetRegisterApi = (data:any) => {
    return request.post('/user/register',data)
}

//获取个人信息用户个人信息
export const userInfoApi = ()=>{
    return request.get('/user/userInfoById');
}

//退出登录
export const userLogoutApi = ()=>{
    return request.post('/user/logout');
}

//获取用户列表
export const getUserListApi = (userName:string)=>{
    return request.get('/user/search',{
        params:{
            username:userName
        }
    });
}

//删除用户
export const deleteUserApi = (ids:number)=>{
    return request.delete('/user/delete',{
        params:{
            id:ids
        }
    });
}